#include "user_print.h"
#include<stdio.h>
#include<string.h>
#define UART_DR *((volatile unsigned char*)0x00001000)
char user_string[512];
void putstring(char*str)
{
    unsigned int i;
    for(i=0;str[i] != 0;i++)
    {
        UART_DR = str[i];
    }
}
int user_printf(char*fmt,...)
{
    va_list ap; 
    int ret;
    va_start(ap, fmt); 
    ret=vsprintf(user_string,fmt,ap); 
    putstring(user_string);
    va_end(ap);
    return ret;
}